package de.dhe.application;

import org.apache.log4j.BasicConfigurator;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import de.preisrobot.persistence.dao.ArtikelDao;

public class Bootstrap {
	
	static Bootstrap instance;

	static ApplicationContext appContext;
	
	
	private Bootstrap(){
		 BasicConfigurator.configure();
	        appContext = new ClassPathXmlApplicationContext("classpath*:applicationContext.xml");

	}
	
	public static Bootstrap getInstance(){
		if(instance==null)
			instance = new Bootstrap();
		return instance;
	}

	public ArtikelDao getArtikelDao() {
		return (ArtikelDao) appContext.getBean("artikelDaoImpl");
		
	}
}
